﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using Volo.Abp;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace BaseInfo
{
    [Comment("科室产品")]
    [Table("t_base_deptproduct")]
    public class DeptProduct : AuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant
    {
        public DeptProduct(Guid keyId)

        {
            this.Id = keyId;
        }

        public DeptProduct()
        {

        }
 
        [Comment("科室id")]
        public Guid DeptId { get; set; }

        [Comment("机构产品id")]
        public Guid ProductId { get; set; }

        [Comment("产品编码")]
        [MaxLength(100)]
        public string ProductCode { get; set; }

        [Comment("管理方式 0数量管理 1定数管理")]
        [MaxLength(100)]
        public int ProductManageType { get; set; }

        [Comment("消耗方式：0 手工消耗 1自动消耗")]
        [MaxLength(100)]
        public int CancelVeriType { get; set; }


        [Comment("结算方式  0不结算，1仓库入库结算， 2科室收货结算 3科室消耗结算")]
        public int SettleType { get; set; } = 0;

        [Comment("是否自动补货 0否 1是")]
        public int IsAutoReple { get; set; }

        [Comment("库存上限")]
        public int StockUpper { get; set; }


        [Comment("库存下限")]
        public int StockLower { get; set; }


        [Comment("是否申请时审核")]
        public int IsApplyAudit { get; set; }

        [Comment("定数")]
        [Column(TypeName = "decimal(18,4)")]
        public decimal DefiniteNum { get; set; }

        [Comment("是否已保存(0.未保存 1.已保存)")]
        public int IsEnable { get; set; }

        [Comment("删除标识")]
        public bool IsDeleted { get; set; } = false;

        [Comment("租户ID")]
        public Guid? TenantId { get; set; }

        [Comment("是否以领代消(0否1是)")]
        public int IsConsumption { get; set; }


        [Comment("是否启用专科专用(是:1 否:0)，默认0")]
        public int IsEnableExclusive { get; set; }

        [Comment("是否入柜(是:1 否:0)，默认0")]
        public int IsCupboard { get; set; } = 0;

        [Comment("是否拆零三级库产品(是:1 否:0)，默认0")]
        public int IsUnpack { get; set; }

        [Comment("备货周期（天）")]
        public int StockingCycle { get; set; }

        [Comment("是否启用")]
        public bool IsActive { get; set; }

        [Comment("是否开启自动补货")]
        [Column(TypeName = "tinyint")]
        public bool IsAutoReplenish { get; set; }
    }
}
